<ion-header>
    <ion-navbar no-border-bottom>
        <ion-title>待办中心</ion-title>
    </ion-navbar>
    <ion-segment class="header_segment" [(ngModel)]="segment" (ionChange)="onSegmentChange($event)">
        <ion-segment-button value="{{item.name}}" *ngFor="let item of segments">
            <span>{{item.text}}</span>
        </ion-segment-button>
        <!--   <ion-segment-button value="todo">
        <span>未办文件</span>
    </ion-segment-button> -->
    </ion-segment>
</ion-header>
<ion-content class='main with-segment' [ngSwitch]="segment">
    <ion-refresher (ionRefresh)="doRefresh($event,true)">
        <ion-refresher-content pullingText="下拉刷新" refreshingText="加载中...">
        </ion-refresher-content>
    </ion-refresher>
    <ion-list class='gfoa-list' *ngSwitchCase="'toBeDeal'">
        <ion-item *ngFor="let item of listData[segment].data" (click)="goDetailPage(item)" [ngClass]="{ 'no-read': item.readflag==0} ">
            <ion-row class='first-row'>
                <ion-col width-80 class='left' [innerHTML]="item.wkiProTitle"></ion-col>
                <ion-col width-20 class='right'>{{item.boCreatorName}}</ion-col>
            </ion-row>
            <ion-row class='second-row'>
                <ion-col width-50 class='left' *ngIf="item.bomid === 't_info_Doc' && item.wkiName === '发文'">正式发文</ion-col>
                <ion-col width-50 class='left' *ngIf="!(item.bomid === 't_info_Doc' && item.wkiName === '发文')">{{item.wkiProName}}</ion-col>
                <ion-col width-50 class='right'>{{item.wkiCreateTime}}</ion-col>
            </ion-row>
        </ion-item>
    </ion-list>
    <ion-list class='gfoa-list' *ngSwitchCase="'todo'">
        <ion-item *ngFor="let item of listData[segment].data" (click)="goDetailPage(item)" [ngClass]="{ 'no-read': item.readflag==0} ">
            <ion-row class='first-row'>
                <ion-col width-80 class='left' [innerHTML]="item.wkiProTitle"></ion-col>
                <ion-col width-20 class='right'>{{item.boCreatorName}}</ion-col>
            </ion-row>
            <ion-row class='second-row'>
                <ion-col width-50 class='left'>{{item.wkiProName}}</ion-col>
                <ion-col width-50 class='right'>{{item.wkiCreateTime}}</ion-col>
            </ion-row>
        </ion-item>
    </ion-list>
    <ion-list class='gfoa-list' *ngSwitchCase="'deal'">
        <ion-item *ngFor="let item of listData[segment].data" (click)="goDetailPage(item)" [ngClass]="{ 'no-read': item.readflag==0} ">
            <ion-row class='first-row'>
                <ion-col width-80 class='left' [innerHTML]="item.wkiProTitle"></ion-col>
                <ion-col width-20 class='right'>{{item.boCreatorName}}</ion-col>
            </ion-row>
            <ion-row class='second-row'>
                <ion-col width-50 class='left'>{{item.wkiProName}}</ion-col>
                <ion-col width-50 class='right'>{{item.wkiCreateTime}}</ion-col>
            </ion-row>
        </ion-item>
    </ion-list>
    <ion-list class='gfoa-list' *ngSwitchCase="'toBeRead'">
        <ion-item *ngFor="let item of listData[segment].data" (click)="goDetailPage(item)" [ngClass]="{ 'no-read': item.readflag==0} ">
            <ion-row class='first-row'>
                <ion-col width-80 class='left' [innerHTML]="item.wkiProTitle"></ion-col>
                <ion-col width-20 class='right'>{{item.boCreatorName}}</ion-col>
            </ion-row>
            <ion-row class='second-row'>
                <ion-col width-50 class='left' *ngIf="!(item.bomid === 't_info_Doc' && item.wkiName === '发文')">{{item.wkiProName}}</ion-col>
                <ion-col width-50 class='left' *ngIf="item.bomid === 't_info_Doc' && item.wkiName === '发文'">正式发文</ion-col>
                <ion-col width-50 class='right'>{{item.wkiCreateTime}}</ion-col>
            </ion-row>
        </ion-item>
    </ion-list>
    <ion-list class='gfoa-list' *ngSwitchCase="'read'">
        <ion-item *ngFor="let item of listData[segment].data" (click)="goDetailPage(item)" [ngClass]="{ 'no-read': item.readflag==0} ">
            <ion-row class='first-row'>
                <ion-col width-80 class='left' [innerHTML]="item.wkiProTitle"></ion-col>
                <ion-col width-20 class='right'>{{item.boCreatorName}}</ion-col>
            </ion-row>
            <ion-row class='second-row'>
                <ion-col width-50 class='left' *ngIf="!(item.bomid === 't_info_Doc' && item.wkiName === '发文')">{{item.wkiProName}}</ion-col>
              <ion-col width-50 class='left' *ngIf="item.bomid === 't_info_Doc' && item.wkiName === '发文'">正式发文</ion-col>
                <ion-col width-50 class='right'>{{item.wkiCreateTime}}</ion-col>
            </ion-row>
        </ion-item>
    </ion-list>
    <ion-item-divider class='list-no-more-tips' color="light" [hidden]="listData[segment].isLoadMore">暂无更多数据...</ion-item-divider>
    <ion-infinite-scroll (ionInfinite)="doInfinite($event,true)">
        <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="加载更多数据...">
        </ion-infinite-scroll-content>
    </ion-infinite-scroll>
</ion-content>
